<template>
  <fieldset>
    <legend>过度动画</legend>
    <button @click="handleClick">点击</button>
    <transition enter-active-class="animate__animated animate__rubberBand"
      leave-active-class="animate__animated animate__bounceOutDown">
      <h1 v-if="flag">你看不见我</h1>
    </transition>
  </fieldset>
</template>

<script>
import "animate.css";
export default {
  data() {
    return {
      flag: true,
    };
  },
  methods: {
    handleClick() {
      this.flag = !this.flag;
    },
  },
};
</script>

<style scoped>
h1 {
  width: 200px;
  border: 2px dashed hotpink;
}
</style>